<?php
/**
* @Copyright Copyright (C) 2010- ... Andy Sharman
* @license GNU/GPL http://www.gnu.org/copyleft/gpl.html
**/
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );

require_once( JPATH_COMPONENT.DS.'helper.php' );

$CF = new customFields();

JToolBarHelper::title( JText::_( 'Custom Fields'), 'plugin.png' );
if (JRequest::getVar('task') != 'add')
{
	echo '<ul id="submenu">
			<li>
			<a href="index.php?option=com_customfields"';
			if (!JRequest::getVar('task')) { echo ' class="active"'; }
			echo '>Custom Fields</a>
			</li>
			<li>
			<a href="index.php?option=com_customfields&amp;task=advanced"';
			if (JRequest::getVar('task') == 'advanced') { echo ' class="active"'; }
			echo '>Advanced</a>
			</li>
		</ul>
		<div class="clr"></div>
		<hr />';
}


echo '<div id="customFieldsContainer">';
//Main component handler
if (!JRequest::getVar('task'))
{
	include_once(JPATH_COMPONENT.DS.'cf.controlFields.php');
}

//Advanced settings area
if (JRequest::getVar('task') == 'advanced')
{
	include_once(JPATH_COMPONENT.DS.'cf.advanced.php');
}
echo '</div>';

echo '<div id="customFieldsPopupContainer">';

// This is the popup handler
if (JRequest::getVar('task') == 'add')
{
	include_once(JPATH_COMPONENT.DS.'cf.popup.php');
}

echo '</div>';

/** DO NOT REMOVE OR TAMPER WITH THE WAY THIS LINK BACK DISPLAYS - SUPPORT OPENSOURCE, IT'S SUPPORTING YOU! */
echo '<a id="sig" href="http://www.udjamaflip.com/" target="_blank" title="Powered by Opensource software from udjamaflip.com">Developed by Andy Sharman</a>';